﻿using OpenTK;

namespace Chimp.Core
{
    public class ChimpEffectPar
    {
        public ChimpEffectPar()
        {
            ThisName = "";
        }

        public ChimpEffectPar(string id, EffectParameterType type)
        {
            ID = id;
            To = null;
            Type = type;
            RawValue = 0.0f;
            RawVec3 = Vector3.Zero;
            RawVec4 = Vector4.Zero;
            RawVec2 = Vector2.Zero;
            ToName = "";
            ThisName = "";
        }

        public string ID { get; set; }
        public string ThisName { get; set; }
        public EffectParameterType Type { get; set; }
        public float RawValue { get; set; }
        public Vector2 RawVec2 { get; set; }
        public Vector3 RawVec3 { get; set; }
        public Vector4 RawVec4 { get; set; }
        public ChimpFXNode Owner { get; set; }
        public string OwnerName { get; set; }
        public ChimpEffectPar To { get; set; }
        public string ToName { get; set; }

        public void EstablishLinks()
        {
            if (ToName != "None")
            {
                To = ChimpFXNode.ParMap[ToName];
            }
            Owner = ChimpFXNode.NodeMap[OwnerName];
        }
    }
}